package top.frsf.mqttproviderapp.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import top.frsf.mqttproviderapp.config.MqttProviderConfig;

@RestController
public class SendController {

    @Autowired
    private MqttProviderConfig providerClient;

    @GetMapping("sendMessage")
    public String sendMessage(String topic, String message, int qos, boolean retained) {
        providerClient.publish(topic, message, qos, retained);
        return "发送成功";
    }

}
